<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./JS/vue.js"></script>
</head>
<body>
    <div id="app">
        <cpn ref="aa"></cpn>
        <cpn ref="bb"></cpn>
        <cpn ref="cc"></cpn>
        <button @click="btnclick">按钮</button>
    </div>
    <template id="cpn">
        <div>
            我是子组件
        </div>
    </template>
    <script>
        const app = new Vue({
            el: '#app',
            data:{
                message: '你好'
            },
            methods:{
                btnclick(){
                    console.log(this.$children);
                    console.log(this.$refs);
                }
            },
            components: {
                cpn:{
                    template: '#cpn',
                    methods: {
                        showMessage(){
                            console.log('showMessage');
                        }
                    }
                }
            }
        })
    </script>
</body>
</html>